import React, { Component } from 'react';
import { Button } from 'antd'
import { connect } from 'react-redux';
class Count extends Component {
    constructor(props){
        super(props)
        console.log(this.props)
    }

    render() {
        let value  = this.props.value
        return (
            <div style={{display:'flex',}}>
                <Button onClick={()=>this.props.dispatch({type:'GOODSLIST',value})}>-</Button>
                <div>{value}</div>
                <Button onClick={()=>this.props.dispatch({type:'GOODSLIST',value})}>+</Button>
            </div>
        );
    }
}
export default connect(state =>state.cartReducers) (Count);